-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Adds a client that enables strict field validation by default. #2860
base: main
Are you sure you want to change the base?
Conversation
|
||
// testFieldValidationClient is a helper function that checks if calls have the expected field validation, | ||
// and calls the callback function on each intercepted call. | ||
func testFieldValidationClient(t *testing.T, expectedFieldValidation string, callback func()) client.Client { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've shamelessly copied and adapted the test code from fieldowner_test.go.
This is almost identical to the testClient
helper function in that file. I would be happy to refactor the two helper functions into one that can be used by both tests. I just think it's wise to copy first, and refactor second.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, lgtm
Putting a hold so others can have a look, too
/hold
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, dlipovetsky The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM label has been added. Git tree hash: 99ddc4de5b300e2bff68e5eb57ae88a950f5e476
|
This allows our users to enable strict field validation by default for all create, update, and patch requests.
The client can be used in a similar way to the specialized fieldManager-configuring client added in #2771.
Fixes #2859